<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>LZXリファレンス lzdatanode</title>
  <othercredit role="translator">
    <firstname>Atuo</firstname>
    <surname>Seki</surname>
        <contrib>2006/05/17　翻訳初版</contrib>
 </othercredit>
<link rel="STYLESHEET" type="text/css" href="../lps/includes/styles.css" /></head>
<body>

<!-- ===================================================================== -->
<!-- = XML information goes here                                         = -->
<!-- ===================================================================== -->
<lzelement title="LzDataNode">
    <lztier>LFC</lztier>
    <lzcategory>Data</lzcategory>
    <lzshortdesc>
             階層的なデータノードの為の基底クラス。
    </lzshortdesc>
    <lzapi>api-lzdatanode.xml</lzapi>
</lzelement>

<p><classname>LzDataNode</classname>はOpenLaszloの
階層的なデータフォーマットを表すクラスの為の基底クラスです。</p>

<example>
&lt;canvas width="300" height="300"&gt;
  &lt;simplelayout axis="y"/&gt;
  &lt;text width="300" height="250" bgcolor="silver" 
        multiline="true" name="display"/&gt;
  &lt;button&gt;Make some data
    &lt;attribute name="currentstep" value="0"/&gt;

    &lt;method event="onclick"&gt;
      &lt;![CDATA[ 
      switch(currentstep ++){
        case 0:
          this.n = <em>new LzDataElement('numbers');</em>
          setAttribute('text', 'Add some children');
          break;
        case 1:
          for (var i = 1; i &lt; 11 ; i++){
            <em>this.n.appendChild(new LzDataElement('number' , 
                                                     {value : i}));</em>
          }
          setAttribute('text', 'Add linebreaks');
          break;
        case 2:
          var dp = new LzDatapointer();
          dp.setPointer(this.n.getFirstChild());
          do {
            <em>dp.p.parentNode.insertBefore(new LzDataText('\n'), 
                                             dp.p);</em>
          } while (dp.selectNext())
          dp.p.parentNode.appendChild(new LzDataText('\n')); 
          setAttribute('visible', false);
          break;
      }
      display.setText(display.escapeText(n.serialize()));
      ]]&gt;
    &lt;/method&gt;
  &lt;/button&gt;
&lt;/canvas&gt;
</example>

</body>
</html>
<!-- * X_LZ_COPYRIGHT_BEGIN ***************************************************
* Copyright 2001-2004 Laszlo Systems, Inc.  All Rights Reserved.              *
* Use is subject to license terms.                                            *
* X_LZ_COPYRIGHT_END ****************************************************** -->
